package com.hotel.system.repository;

import com.hotel.comm.bean.system.EjobCity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface IEjobCityRepository extends JpaRepository<EjobCity, Long> {
    @Query("select ec from EjobCity ec where ec.isOnline = 'ONLINE'")
    public List<EjobCity> findAllOnlineCity();

    /**
     * 获取所有置顶地市信息
     *
     * @return
     */
    @Query("select ec from EjobCity ec where ec.isOnline = 'ONLINE' and ec.isTop = 'TOP' order by ec.id")
    public List<EjobCity> findAllTopCitys();

    /**
     * 获取所有非置顶地市信息
     *
     * @return
     */
    @Query("select ec from EjobCity ec where ec.isOnline = 'ONLINE' and ec.isTop = 'NONTOP' order by ec.cityNamePy")
    public List<EjobCity> findAllNonTopCitys();

}
